package jbrowser.services;

import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.Enumeration;
import javax.security.auth.login.LoginException;
import sun.security.provider.PolicyParser.GrantEntry;

public interface SecurityManagerService extends Service {

    public SecurityManager getSecurityManager();

    public Enumeration<GrantEntry> grantElements();
    
    public boolean grant(GrantEntry grantEntry);

    public <T> T sudo(PrivilegedAction<T> action) throws LoginException;

    public <T> T sudo(PrivilegedExceptionAction<T> action) throws LoginException, PrivilegedActionException;
}
